package mundo;

import processing.video.*;
import processing.core.PApplet;
import processing.opengl.*;

import jp.nyatla.nyar4psg.*;

public class RealidadAumentada extends PApplet {

	private static final long serialVersionUID = 1L;

	private Capture cam;
	private NyARBoard mark1;

	public static void main(String args[])
	{
		PApplet.main(new String[] { "--present", procesamientoDeVideo.Proyecto.class.getName() });
	}

	public void setup() {
		size(800,600,OPENGL);
		colorMode(RGB, 100);
		cam=new Capture(this,width,height);

		mark1=new NyARBoard(this,width,height, "camera_para.dat", "patt.hiro", 80);
		mark1.gsThreshold=120;
		mark1.cfThreshold=0.4;
		try {
			quicktime.QTSession.open();
		} catch (quicktime.QTException qte) {
			qte.printStackTrace();
		}

	}

	public void draw() {

		if (cam.available())
		{
			cam.read();
			hint(DISABLE_DEPTH_TEST);
			image(cam,0,0);
			hint(ENABLE_DEPTH_TEST);
			/*
			if(mark1.detect(cam))
			{
				PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
				mark1.beginTransform(pgl);

				//TRABAJAR AQUI//

				fill (0, 147, 173, 150);
				ellipse(0, 0, 150, 150);
				fill(2000, 16, 59, 150);
				ellipse(190, 0, 150, 150);
				mark1.endTransform();
			}
			 */
		}
	}
}
